{% load staticfiles %}

<div id="{{ id }}">
    <textarea name="{{ name }}" style="display:none;">{{ body }}</textarea>
</div>

<script type="application/javascript" src="{% static 'vendor/editormd/js/editormd.js' %}"></script>
<script type="text/javascript">
    $(function () {
        var editor = editormd("{{ id }}", {
            width: "100%",
            height: 500,
            // theme : "dark",
            // previewTheme : "dark",
            // editorTheme : "pastel-on-dark",
            syncScrolling: "single",
            path: "/static/vendor/editormd/lib/",
            emoji: true,
            autoFocus: false,
            imageUpload: true,
            imageUploadTokenURL: '{{ imageUploadTokenURL }}',
            imageUploadURL: '{{ imageUploadURL }}',
            imageRequestBaseURL: '{{ imageRequestBaseURL }}',
            imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "svg"]
        });
    });
</script>